package com.main.ok.com;

import java.util.ArrayList;
import java.util.List;

public class Main {

    public static void main(String[] args) {
        List<Person> l1 = new ArrayList<Person>();
        for (int i = 0; i < 100; i++) {
            Person p = new Person();
            p.setId(i);
            p.setName("person" + i);
            l1.add(p);
        }

        List<Person> l2 = new ArrayList<Person>();
        for (int i = 10; i < 120; i++) {
            Person p = new Person();
            p.setId(i);
            p.setName("person" + i);
            l2.add(p);
        }

        l1.retainAll(l2);
        System.out.println(l1.size());

    }
}
